<script language="JavaScript" type="text/javascript">
$(document).ready(function (){
	show_menu('添加文章');	
})
</script>
  		
		<div class="box">
			<h3><?=$post_title?></h3>
			<?php if($this->session->flashdata('success_message')):?>
			<div id="succeed" style="clear: right"><?=$this->session->flashdata('success_message');?></div>
			<?
				echo "<script>setTimeout(function (){document.getElementById('succeed').style.display = 'none';}, 5000)</script>";
			?>
			<?php endif;?>
			
			<?php if($this->session->flashdata('update_message')):?>
			<div id="notice" style="clear: right"><?=$this->session->flashdata('update_message');?></div>
			<?
				echo "<script>setTimeout(function (){document.getElementById('notice').style.display = 'none';}, 5000)</script>";
			?>
			<?php endif;?>
			
			<?=validation_errors('<p class="error" style="margin:0;">', '</p>'); ?>
			<?=form_open('admin/post', array('id'=>'subForm')); ?>
			<?=form_hidden('id',$id)?>
			<ul>
				<li>
					<label>文章名称</label>
					<div><input type="text" name="name" class="text medium" value="<?=set_value('name', $post_records->name)?>" /></div>
				</li>
				<li>
					<label>Textarea Sample</label>
					<div><textarea name="content" id="content_id" rows="6" cols="70" tabindex="1" class="textarea"><?=set_value('content', $post_records->content)?></textarea></div>
				</li>
				<li>
					<label>文章分类</label>
					<div>
					<?
					$options = array();
					foreach($post_type_records as $post_type_record)
					{
						$options[$post_type_record->id] = $post_type_record->name;
					}
					echo form_dropdown('typeid', $options, set_value('typeid', $post_records->typeid == '' ? '' : $post_records->typeid ));
					?>
					</div>
				</li>
				<li>
					<label>文章排序</label>
					<div>
					<?
					$options = array();
					for ($i = 1; $i <= 50; $i++)
					{
						$options[$i] = $i;
						
					}
					echo form_dropdown('order', $options, set_value('order', $post_records->order == '' ? 20 : $post_records->order));
					?>
					</div>
				</li>
				<li>
					<label>是否显示</label>
					<div>
					<?
					$options = array(1=>'显示', 0=>'隐藏');
					echo form_dropdown('status', $options, set_value('status', $post_records->status == '' ? '' : $post_records->status));
					?>
					</div>
				</li>
				<li>
					<label>关键字</label>
					<div><input type="text" name="keywords" class="text medium" value="<?=set_value('keywords', $post_records->keywords)?>" /></div>
				</li>
				<li>
					<input type="Submit" value="Submit" class="button" /> <input type="Reset" value="Reset" class="button" />
				</li>
			</ul>
			</form>
		</div>
		
<script language="JavaScript" type="text/javascript" src="<?=base_url();?>js/kindeditor-3.5.5/kindeditor.js"></script>
<script language="JavaScript" type="text/javascript">
  KE.show({
                id : 'content_id',
                resizeMode : 1,
				allowPreviewEmoticons : false,
				allowUpload : true,
				width: '470px',
				height: '350px',
				items : [
				'source', '|', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|', 'emoticons', 'image', 'upload', 'link']
                
        });
</script>		